package com.wise.site.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ScrollView;

public class HeadlineScrollView extends ScrollView {
	private boolean isScrollDisable;
	private View fouceView;
	
	public HeadlineScrollView(Context context) {
		this(context, null);
	}
	
	public HeadlineScrollView(Context context, AttributeSet attrs) {
		this(context, attrs, -1);
	}

	public HeadlineScrollView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}
	
	@Override
	public boolean onTouchEvent(MotionEvent ev) {
		if(isScrollDisable && fouceView != null){
			fouceView.onTouchEvent(ev);
			return true;
		}
		// TODO Auto-generated method stub
		return super.onTouchEvent(ev);
	}
	
	public void setScrollDisable(View fouceView, boolean disable)
	{
		this.fouceView = fouceView;
		isScrollDisable = disable;
	}
}
